package com.example.shop.service.impl;

import com.example.shop.entity.Organizationtype;
import com.example.shop.dao.OrganizationtypeMapper;
import com.example.shop.service.OrganizationtypeService;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;

import java.util.List;

/**
 * (Organizationtype)表服务实现类
 *
 * @author makejava
 * @since 2025-03-26 09:26:38
 */
@Service("organizationtypeService")
public class OrganizationtypeServiceImpl implements OrganizationtypeService {
    @Resource
    private OrganizationtypeMapper organizationtypeMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param organizationtypeid 主键
     * @return 实例对象
     */
    @Override
    public Organizationtype queryById(Integer organizationtypeid) {
        return this.organizationtypeMapper.queryById(organizationtypeid);
    }


    /**
     * 新增数据
     *
     * @param organizationtype 实例对象
     * @return 实例对象
     */
    @Override
    public Organizationtype insert(Organizationtype organizationtype) {
        this.organizationtypeMapper.insert(organizationtype);
        return organizationtype;
    }

    /**
     * 修改数据
     *
     * @param organizationtype 实例对象
     * @return 实例对象
     */
    @Override
    public Organizationtype update(Organizationtype organizationtype) {
        this.organizationtypeMapper.update(organizationtype);
        return this.queryById(organizationtype.getOrganizationtypeid());
    }

    /**
     * 通过主键删除数据
     *
     * @param organizationtypeid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer organizationtypeid) {
        return this.organizationtypeMapper.deleteById(organizationtypeid) > 0;
    }

    @Override
    public List<Organizationtype> queryAll() {
        return null;
    }
}
